package prototype.persistence.hibernate;

import java.util.List;
import java.sql.Timestamp;

import prototype.persistence.pojo.User;
import prototype.persistence.UserDAO;

import org.hibernate.criterion.Restrictions;

/**
 * <p>Hibernate DAO layer for Users</p>
 * <p>Generated at Sun Jan 03 13:49:53 EET 2010</p>
 *
 * @author Salto-db Generator v1.0.16 / Pojos + Hibernate mapping + Generic DAO
 * @see http://www.hibernate.org/328.html
 */
public class UserHibernateDAO extends
		AbstractHibernateDAO<User, Integer> implements
		UserDAO {

	/**
	 * Find User by name
	 */
	public List<User> findByName(String name) {
		return findByCriteria(Restrictions.eq("name", name));
	}
	
	/**
	 * Find User by team
	 */
	public List<User> findByTeam(Integer team) {
		return findByCriteria(Restrictions.eq("team", team));
	}
	
	/**
	 * Find User by scenarioId
	 */
	@SuppressWarnings("unchecked")
	public List<User> findByScenarioId(Integer scenarioId) {
		return findByCriteria(Restrictions.eq("scenario.scenarioId", scenarioId));
	}
	

}
